/**
 * @Time    : 2022/03/10 12:18
 * @Author  : WanRongJia
 * @License : Software business license
 * @Site    : www.rich-f.com
 * @File    : itemNotFound.js
 * @Software: Rich Web Platform
 * @Function: 记录没有查到的错误返回
 * @Version : 1.0
 **/
const { buildErrObject } = require('./buildErrObject');

const itemNotFound = (err = {}, item = {}, message = 'NOT_FOUND') => {
    return new Promise((resolve, reject) => {
        if (err) {
            return reject(buildErrObject(500, err.message))
        }
        if (!item) {
            return reject(buildErrObject(422, message))
        }
        resolve()
    })
};

module.exports = { itemNotFound }
